package com.etc.extendsdemo;

/**
 * @author: knowno
 * @create: 2024-09-05 14:21
 * @Version 1.0
 **/
public class TestStudent {
    public static void main(String[] args) {

        //不同学生[子类对象]
        Pupil pupil = new Pupil();
        pupil.setAge(12);
        pupil.setId("20240001");
        pupil.setName("小a");

        System.out.println(pupil);
        pupil.study();


        MiddleStudent ms = new MiddleStudent();
        ms.setAge(15);
        ms.setId("20240002");
        ms.setName("小b");

        System.out.println(ms);
        ms.study();

        CollegeStudent cs = new CollegeStudent();
        cs.setAge(19);
        cs.setId("20240003");
        cs.setName("小c");


        System.out.println(cs);
        cs.study();
    }
}
